package com.cp.weixin.blog.service;

import com.cp.weixin.blog.repository.Record;

import java.util.Date;
import java.util.List;

// @CacheConfig(cacheNames = "recordCache")
public interface RecordService {

	// @Cacheable
	Record getRecordByUrlMd5(String md5);

	int addRecord(String uid, String title, String content, String source, Date pubtime, Date publish_time, String md5, String query, Integer readCount, Integer state, Integer category_id, String tags);

	int addRecord(Record record, Integer categoryId);

	List<Record> getRecordByPageAndStateAndCategoryId(Integer state, Integer categoryId, Integer tagId);

	// @Cacheable
	Record getRecordByUid(String uid);

	// @Cacheable
    Record getRecordByTitle(String title);

	// @CachePut
	int updateRecord(Record record);

	// @CachePut
	int updateAndPublishRecord(Record record, Integer categoryId);

	// @CachePut
	int readCountPlus(String uid);

}
